@(qcmForm: Form[Qcm], qcm: Qcm, ppf: String, pnf: String, ppm: String, pnm: String, ppd: String, pnd: String, ppb: String, pnb: String)
@import helper._


@main("Notation"){
@header()
@helper.form(action = routes.CreateQCM.submit(3)) {
	<fieldset>
	<div class="bs-docs-example" >
	<div class="bs-docs-example-after" >
		Etape 3 sur 4
		</div>	
	
		<legend>QCM : Information gen&eacute;ral</legend>	
		<br/>
					<div>
					<label>Libell&eacute; : </label>
					<INPUT type="text" name="libelle" value="@qcmForm("libelle").value" disabled="disabled">
					</div>
					
					<div class="row">
					<div class="span4">
				   <label>Date d'ouverture du Qcm : </label>
				    <INPUT type="text" name="libelle" value="@qcm.getDateOuverture().format("dd/MM/yyyy HH:mm")" disabled="disabled">
				    </div>
				    <div class="span4">
				    <label>Date de cloture du Qcm : </label>
				    <INPUT type="text" name="libelle" value="@qcm.getDateCloture().format("dd/MM/yyyy HH:mm")" disabled="disabled">
 		
				 	</div>
				 	</div>
				</br> 	
			<legend>Liste des questions</legend>	
						<table class="table table-striped sortable">
					
						<thead>
							<tr>
								<th>Libell&eacute </th>
								<th>Niveau de difficult&eacute </th>
							</tr>
							<thead>
							<tbody>
							@for(question <- qcm.getListeQuestions()){
							<tr>
							<td>@question.getLibelleQuestion()</td>
							<td>@question.getNiveauQuestion().getLibelleNiveau() </td>
							</tr>
							}
							</tbody>
						</table>
						
						
			<legend>Notation : </legend>
</br>				
<h5>Facile : </h5>	
<div class="row">
    <div class="ppf control-group span4">
      <div class="controls">
      	<label>Point Positif </label>
        <input type="text" name="ppf" id="ppf" value="@ppf" required>
        <div class="alertppf alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>	
<div class="pnf control-group span4">
      <div class="controls">
      	<label>Point Negatif </label>
        <input type="text" name="pnf" id="pnf" value="@pnf" required>
        <div class="alertpnf alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
</div>
<h5>M&eacute;dium  : </h5>		
<div class="row">
    <div class="ppm control-group span4">
      <div class="controls">
      	<label>Point Positif </label>
        <input type="text" name="ppm" id="ppm" value="@ppm" required>
        <div class="alertppm alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
    <div class="pnm control-group span4">
      <div class="controls">
      	<label>Point Negatif </label>
        <input type="text" name="pnm" id="pnm" value="@pnm" required>
        <div class="alertpnm alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
</div>	
<h5>Difficile  : </h5>
<div class="row">
    <div class="control-group span4">
      <div class="ppd controls">
      	<label>Point Positif </label>
        <input type="text" name="ppd" id="ppd" value="@ppd" required>
        <div class="alertppd alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
    <div class="pnd control-group span4">
      <div class="controls">
      	<label>Point Negatif </label>
        <input type="text" name="pnd" id="pnd" value="@pnd" required>
        <div class="alertpnd alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
</div>	
<h5>Bonus :</h5>
<div class="row">
    <div class="ppb control-group span4">
      <div class="controls">
      	<label> Point Positif </label>
        <input type="text" name="ppb" id="ppb" value="@ppb" required>
        <div class="alertppb alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
</div>	
    <div class="pnb control-group span4">
      <div class="controls">
      	<label>Point Negatif </label>
        <input type="text" name="pnb" id="pnb" value="@pnb" required>
        <div class="alertpnb alert alert-error hide">
          <h4 class="alert-heading">Erreur !</h4>
          Vous devez entrer un nombre positif (ex: 0.5 ou 1) ! </div>
      </div>
    </div>
</div>	

</div>
</fieldset>
		
            
 <div class="actions"> 	
     	<button id="action" type="submit" name="action" value="retour" class="btn btn-primary">
			Retour <i class="icon-white icon-circle-arrow-left"></i> 
		</button>
		
       	<button id="action" type="submit" name="action" value="valider"class="btn btn-primary">
			Valider <i class="icon-white icon-circle-arrow-right"></i>
		</button>
</div>
<script type="text/javascript">
  $(function(){
    $("form").on("submit", function(){
    	var ppf = $('#ppf').val();
    	var pnf = $('#pnf').val();
    	var ppm = $('#ppm').val();
    	var pnm = $('#pnm').val();
    	var ppd = $('#ppd').val();
    	var pnd = $('#pnd').val();
    	var ppb = $('#ppb').val();
    	var pnb = $('#pnb').val();
    	var floatN =parseFloat(ppf);
    	if (!isFinite(ppf)||floatN < 0) {
    		$("div.ppf").addClass("error");
            $("div.alertppf").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(pnf);
    	if (!isFinite(pnf)||floatN < 0) {
    		$("div.pnf").addClass("error");
            $("div.alertpnf").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(ppm);
    	if (!isFinite(ppm)||floatN < 0) {
    		$("div.ppm").addClass("error");
            $("div.alertppm").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(pnm);
    	if (!isFinite(pnm)||floatN < 0) {
    		$("div.pnm").addClass("error");
            $("div.alertpnm").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(ppd);
    	if (!isFinite(ppd)||floatN < 0) {
    		$("div.ppd").addClass("error");
            $("div.alertppd").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(pnd);
    	if (!isFinite(pnd)||floatN < 0) {
    		$("div.pnd").addClass("error");
            $("div.alertpnd").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(ppb);
    	if (!isFinite(ppb)||floatN < 0) {
    		$("div.ppb").addClass("error");
            $("div.alertppb").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	var floatN =parseFloat(pnb);
    	if (!isFinite(pnb)||floatN < 0) {
    		$("div.pnb").addClass("error");
            $("div.alertpnb").show("slow").delay(3500).hide("slow");
            return false;
    	}
    	
    	
    }
    
    )});  
</script>
}
}
